package org.ucas.faker.web.fetcher.meta;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class Table  implements Serializable {

  public Class clazz;

  public String name;

  public List<ColumnField> columns = new ArrayList<>();

  public Table() {
  }

  public Table(String name) {
    this.name = name;
  }

  public String sql() {
    return name;
  }

  @Override
  public int hashCode() {
    return sql().hashCode();
  }

  @Override
  public boolean equals(Object obj) {
    return obj instanceof Table && name.equals(((Table) obj).name);
  }
}
